package com.leather.news.controller;

import com.leather.news.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class NewsController {

    @Autowired
    private NewsService newsService;

    @GetMapping("/list")
    public Object getNewsList(@RequestParam("pageId") int pageId) {
        return newsService.getNewsList(pageId);
    }

    @PostMapping("/get")
    public Object getNews(@RequestParam("newsId") String newsId) {
        return newsService.getNewsByNewsId(newsId);
    }
}
